package com.Ieasy.Tool;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Tool {
    public void imgData(String url){
        Pattern pattern = Pattern.compile("src=(\"|'| |)([\\S]{1,}?|[/]{1,})([/]{1,})(.+?)([/]{1,})(.+?)\\.(png|jpg|jpeg)(\"|'| |/>)");

        Matcher matcher = pattern.matcher(url);
        System.out.println(matcher.find());
        while(matcher.find()){

            System.out.println("-------------------");

            String host = matcher.group(4);

            String imgUrl = matcher.group(2) + matcher.group(3) + matcher.group(4) + matcher.group(5) + matcher.group(6) + "." + matcher.group(7);

            System.out.println(host);

            System.out.println(imgUrl);

        }

    }
}
